{extend name="admin@public/basic"}

{block name="content"}
<div class = "fragment">
    <!--顶部菜单栏开始-->
    <nav class = "navbar navbar-expand-sm navbar-light bg-light">
        <a class = "navbar-brand" href="#">ThinOkay</a>
        <div class = "collapse navbar-collapse">
            <ul class = "navbar-nav mr-auto">
                {foreach $nodes as $oneMenu}
                <li class = "nav-item" >
                    <a data-open="{if condition='$oneMenu.rule eq "#"'}{$oneMenu.rule}{else}{:url($oneMenu['rule'])}{/if}" data-menu-node="m-{$oneMenu.id}" class = "nav-link">
                        {notempty name="$oneMenu.icon"}<i class = "fa {$oneMenu.icon}"></i>{/notempty}
                        {$oneMenu.name|default=''}
                    </a>
                </li>
                {/foreach}
            </ul>
            <span class = " dropdown">
                <a class = "nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {:session('user.username')}
                </a>
                <div class = "dropdown-menu">
                    <a class = "dropdown-item" data-action="ajax" data-action-url="{:url('admin/login/logout')}">退出登录</a>
                    <a class = "dropdown-item" data-action="dialog" data-dialog-title="修改资料" data-action-url="{:url('admin/user/edit',['id' => session('user.id')])}">
                        修改资料
                    </a>
                    <a class = "dropdown-item" data-action="dialog"  data-dialog-title="修改密码" data-action-url="{:url('admin/user/password',['id' => session('user.id')])}">
                        修改密码
                    </a>
                </div>
            </span>
        </div>
    </nav>
    <!--顶部菜单栏结束-->
    <div class = "body">
        <!--左侧菜单栏开始-->
        {foreach $nodes as $oneMenu}
        {notempty name='$oneMenu.sub'}
        <div class = "leftbar-container hide notselect" data-menu-layout="m-{$oneMenu.id}">
            <div class = "line-split">...</div>
            {foreach $oneMenu.sub as $twoMenu}
            {if condition="$twoMenu.type eq 1"}
            {empty name="$twoMenu.sub"}
            <a class = "transition" data-menu-node="m-{$oneMenu.id}-{$twoMenu.id}" data-open="{if condition='$twoMenu.rule eq "#" or $twoMenu.rule eq ""'}#{else/}{:url($twoMenu.rule)}{/if}">
                {notempty name='$twoMenu.icon'}<i class = "fa {$twoMenu.icon}"></i>{/notempty}
                {$twoMenu.name}
            </a>
            {else}
            <div data-submenu-layout="m-{$oneMenu.id}-{$twoMenu.id}">
                <a class = "menu-title transition" data-thrd-menu>
                    {notempty name="twoMenu.icon"}<i class = "fa {$twoMenu.icon}"></i>{/notempty}
                    {$twoMenu.name}
                </a>
                <div class = "thrd-menu">
                    {foreach $twoMenu.sub as $thrMenu}
                    {if condition="$thrMenu.type eq 1"}
                    <a class='transition' data-open="{if condition='$thrMenu.rule eq "#" or $thrMenu.rule eq ""'}#{else/}{:url($thrMenu.rule)}{/if}" data-menu-node="m-{$oneMenu.id}-{$twoMenu.id}-{$thrMenu.id}">
                        {notempty name='thrMenu.icon'}<span class='{$thrMenu.icon} font-icon'></span>{/notempty} {$thrMenu.name}
                    </a>
                    {/if}
                    {/foreach}
                </div>

            </div>
            {/empty}
            {/if}
            {/foreach}

        </div>
        {/notempty}
        {/foreach}
        <!--左侧菜单栏结束-->
        <div class = "main" id = "main">

        </div>
    </div>
    <div class="modal fade" id = "action-dialog-modal"  tabindex="-1" role="dialog" aria-labelledby="action-dialog-title" aria-hidden="true">
        <div class="modal-dialog" role="document" >
            <div class="modal-content" id="action-dialog">
                <div class="modal-header">
                    <h5 class="modal-title" id="action-dialog-title">对话框</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body" id = "action-dialog-body">

                </div>

            </div>
        </div>
    </div>
    <div class="modal" tabindex="-1" role="dialog" id = "confirm-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id = "confirm-moal-title">确认框</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body" id = "confirm-modal-body">

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id = "confirm-ok">确认</button>
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>


{/block}